import request from '@/utils/request'

// 查询耗材列表
export function listInfo(query) {
  return request({
    url: '/consumables/info/list',
    method: 'get',
    params: query
  })
}

// 新增耗材
export function addInfo(data) {
  return request({
    url: '/consumables/info',
    method: 'post',
    data: data
  })
}

// 删除耗材
export function delInfo(id) {
  return request({
    url: '/consumables/info/' + id,
    method: 'delete'
  })
}

// 分配耗材
export function reqDistribution(data) {
  return request({
    url: '/consumables/info/distribution',
    method: 'post',
    data: data
  })
}

// 回收耗材
export function reqRecovery(id) {
  return request({
    url: '/consumables/info/recovery/' + id,
    method: 'put',
  })
}

// 通过号段批量操作耗材
export function batchOperateInfo(url, data) {
  return request({
    url: url,
    method: 'post',
    data: data
  })
}
